using System;
using System.Collections.Generic;
using System.Text;
using DAL;
using Entities;

namespace BUS
{
 public    class tbDiemdenBUS
    {
        public static void insert(tbDiemden  dden)
        {
            tbDiemdenDAL  ddenDAL = new tbDiemdenDAL ();
            ddenDAL.Insert (dden );

        }
     public static void update(tbDiemden dden)
        {
            tbDiemdenDAL  ddenDAL = new tbDiemdenDAL ();
            ddenDAL.Update (dden ) ;

        }
     public static void Delete(int iD)
     {
         tbDiemdenDAL  ddenDAL = new tbDiemdenDAL ();
         ddenDAL.Delete(iD);
     }
        public static tbDiemdenCollection  Get(string where, int pageindex, int pagesize, string orderby, string orderdirection, out int total)
        {
            tbDiemdenDAL ddDAL = new tbDiemdenDAL();
            return ddDAL.Get(where, pageindex, pagesize, orderby, orderdirection, out total);
        }

        public static tbDiemdenCollection  GetALL()
        {
            int total = 0;
            tbDiemdenDAL ddDAL = new tbDiemdenDAL();
            return ddDAL.Get("where 1=1", 0, 0, tbDiemdenColumn .Madden .ToString(), "ASC", out total);
        }
        public static tbDiemden  GetByID(int iD)
        {
            int total = 0;
            tbDiemdenDAL ddDAL = new tbDiemdenDAL();
        tbDiemdenCollection  ddCollection = ddDAL.Get("where " +
            tbDiemdenColumn.Madden .ToString() + "=" + iD.ToString(),
                0, 0, tbDiemdenColumn .Madden .ToString(), "ASC", out total);
            if (ddCollection.Count > 0)
                return ddCollection[0];
            return null;
        }
    }
}
